package com.example.service;

import org.springframework.stereotype.Service;

@Service 
public class OrderServiceImpl implements OrderService {

    
    @Override
    public void add(String pname, int number) {
        System.out.println("=== 业务逻辑：成功添加 [" + pname + "] " + number + " 个到购物车 ===");
    }

    @Override
    public void delete(String pname) {
        System.out.println("=== 业务逻辑：成功从购物车删除商品 [" + pname + "] ===");
    }

    @Override
    public int find(String pname) {
    
        int count = (int) (Math.random() * 10 + 1);
        System.out.println("=== 业务逻辑：查询到购物车中 [" + pname + "] 的数量为 " + count + " ===");
        return count; 
    }
}
